import React, { Component, useContext } from 'react'
import Context from '../utils/context'

const Demo2 = () => {
  let { state, dispatch }: any = useContext(Context)
  return (
    <div>
      <h1>{state.count}</h1>
      <button onClick={() => {
        dispatch({ type: 'addCount' })
      }}>添加数据</button>

      {/* hello world   demo1
      <Context.Consumer>

      </Context.Consumer> */}
    </div>
  )
}

export default Demo2
